Avoid storing last_changed in the database if its the same as last_updated#71843
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( |
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( |
|
Need to write docs for this. |
… actually work because of the `split_entity_id(ent_id)[0] in NEED_ATTRIBUTE_DOMAINS` guard
balloob
left a comment
There was a problem hiding this comment.
Nice! I think that we can also leverage this on the frontend and not send both over if they are the same.
Thats a good idea. I think we can cleanup https://github.com/home-assistant/frontend/blob/dev/src/data/history.ts#L260 a bit more once home-assistant/frontend#12662 merges but I don't want to make it any bigger |
|
Proposed change
Data PR home-assistant/data.home-assistant#214
Since
last_updatedandlast_changedare stored as strings in the database they take upquite a bit of space.
In testing various production instances, ~75%-96% of
last_changedwas the same aslast_updatedType of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: